package com.ke.forum.mbg.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ke.forum.mbg.entity.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ke.forum.mbg.entity.dto.ArticleDto;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 珂
 * @since 2021-05-22
 */
@Repository
public interface ArticleMapper extends BaseMapper<Article> {
    Page<ArticleDto> listArticleSortByCreatetime(Page<ArticleDto> page, Integer sectionId);

    Page<ArticleDto> listArticleSortByViews(Page<ArticleDto> page, Integer sectionId);

    Page<ArticleDto> listRareSortByCreatetime(Page<ArticleDto> page, Integer sectionId);

    Page<ArticleDto> listRareSortByViews(Page<ArticleDto> page, Integer sectionId);

    ArticleDto getArticleInfo(Integer id);

    Page<ArticleDto> listArticleByUserUuid(Page<ArticleDto> page,String userUuid);

    List<ArticleDto> listTopArticle(Integer sectionId);

    Page<ArticleDto> listStarUserArticles(Page<ArticleDto> page,String userUuid);

    Integer getUserArticleNum(String userUuid);
}
